package com.example.demo;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/hello")
public class helloController {

    /**
     * 支持get, 两者等价
     * @return
     */
//    @RequestMapping(value = "/hello1", method = RequestMethod.GET)
//    @GetMapping("/hello1")

    /**
     * 支持get, post
     * @return
     */
//    @RequestMapping(value = "/hello1", method = {RequestMethod.GET,RequestMethod.POST})
    @RequestMapping("/hello1")
    public String hello1() {
        return "hello-spring-boot-1";
    }


    /**
     * 支持post
     * @return
     */
//    @PostMapping("/hello2")
    @RequestMapping("/hello2")
    public Integer hello2() {
        return 222;
    }

    @RequestMapping("/hello3")
    public int hello3() {
        return 333;
    }



}
